#pragma once
#include <string>
#include <vector>
#include <memory>
#include <utility>
#include <ctime>
#include <mutex>
#include <opencv2/opencv.hpp>

#include "common/model_config.h"
#include "rockchip/base/rk_predictor.h"
#include "rockchip/rkmodel_manager.h"


namespace ai {
#define I_SIZE_CARPLATE_REC 1638

class RKOcrRecPredictor : public RKPredictor {
public:
  RKOcrRecPredictor(RKPackPredictor* model, RKModelManager* mng, LogInfo *lg);
  ~RKOcrRecPredictor(){}
  
private:
  int RunDet(stream::ImageBlob* blob, std::vector<BaseInfo*>& det_infos) ;

  int PostProcess(std::vector<BaseInfo*>& det_infos, 
                int cur_block,
                RKModelManager* mng, 
                int md_idx);

private:
  int start_postprocess_thread_imp();
  int GetConvDetectionResult(ai::ModelConfig *cfg,  std::vector<std::vector<float>>& output_tensors, std::vector<int> &qnt_zp, std::vector<float> &qnt_scale, std::vector<BaseInfo*>& det_infos);

  void ParseTensor(float* out_data, int layer, 
    std::vector<cv::Rect>& boxs, std::vector<float>& scores, std::vector<int>& labels,
    std::vector<int> ori_shape, std::vector<int> feteature_shape, ModelConfig* cfg);
  // int get_tensor_hw(hbDNNTensor* tensor, int *height, int *width);



private:
  
};



}  // namespace hb
